class Admin::ZcmController < ApplicationController
  
  layout "main"
  #
  def index
   
  end
  
  def add
    @zcm=Zcm.new(params[:zcm])
    if request.post? and @zcm.save
      show_message('保存成功','green')
    end
  end
  
  def edit
    @zcm=Zcm.find(params[:id])
  end
  
  def update
    @zcm=Zcm.find(params[:id])
    if @zcm.update_attributes(params[:zcm])
      show_message('修改成功','green')
    end
    redirect_to :action=>'edit',:id=>@zcm
  end
  
  def del
    @zcm=Zcm.find(params[:id])
    if @zcm.destroy
      show_message('删除成功','green')
      redirect_to :action=>'index'
    end
  end
  

  
end
